<%= header %>
<%= boomerangScript %>
<script src="../../vendor/angular/angular.js"></script>
<script src="../../vendor/angular-resource/angular-resource.js"></script>
<script src="../../vendor/angular-route/angular-route.js"></script>
<script src="support/app.js"></script>
<div ng-app="app">
	<div ng-view>
	</div>
</div>
<script src="106-backendtime-script.js" type="text/javascript"></script>
<script>
window.angular_imgs = [-1];

BOOMR_test.init({
	testAfterOnBeacon: BOOMR.plugins.AutoXHR ? 2 : 1,
	afterFirstBeacon: function() {
		if (!BOOMR.plugins.AutoXHR) {
			return;
		}

		//
		// Send a XHRs, and insert an image after it comes back
		//
		BOOMR.plugins.SPA.route_change();
		setTimeout(function(){
			var xhr = new XMLHttpRequest();
			xhr.open("GET", "/delay?delay=1000&file=/pages/05-angular/support/widgets.json&id=1&rnd=" + Math.random(), true);
			xhr.send(null);

			var script = document.createElement("script");
			script.src = "/delay?delay=1500&file=/pages/05-angular/support/hello.js&TAO=1&rnd=" + Math.random();
			document.head.appendChild(script);

			// use secondary port to simulate 3rd party resource (will be missing responseStart in resource timing)
			var urlPrefix = "//" + window.location.hostname + ":" + (parseInt(window.location.port, 10) + 1);
			var script2 = document.createElement("script");
			script2.src = urlPrefix  + "/delay?delay=1500&file=/pages/05-angular/support/hello.js&TAO=0&rnd=" + Math.random();
			document.head.appendChild(script2);
		}, 0);
	},
	Angular: {
		enabled: true
	},
	instrument_xhr: true,
	autorun: false
});
</script>
<%= footer %>
